package dragon.modules.system.menu.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class SysMenu2 implements Serializable, Cloneable {

	@Override
	public SysMenu2 clone() throws CloneNotSupportedException {
		SysMenu2 menu = (SysMenu2) super.clone();
		if (this.children != null && this.children.size() > 0) {
			List<SysMenu2> list = new ArrayList<SysMenu2>(this.children.size());
			for (SysMenu2 child : this.children) {
				list.add(child.clone());
			}
			menu.children = list;
			list = null;
		}
		return menu;
	}

	private int id;

	private int pid;

	private String idpath;

	private String kind;

	private String name;

	private String url;

	private String description;

	private int ordernum;

	private String icon;

	private String state;

	// 层级
	private int depth;

	// 对用户是否可见
	private int visible;

	// 子节点
	List<SysMenu2> children;

	@Override
	public String toString() {
		StringBuilder str = new StringBuilder();
		str.append("dragon.modules.system.menu.vo.SysMenu2:").append("\n");
		str.append("id=").append(id).append("\t");
		str.append("pid=").append(pid).append("\t");
		str.append("idpath=").append(idpath).append("\t");
		str.append("kind=").append(kind).append("\t");
		str.append("name=").append(name).append("\t");
		str.append("url=").append(url).append("\t");
		str.append("description=").append(description).append("\t");
		str.append("ordernum=").append(ordernum).append("\t");
		str.append("icon=").append(icon).append("\t");
		str.append("state=").append(state).append("\t");
		str.append("depth=").append(depth).append("\t");
		str.append("visible=").append(visible).append("\t");
		str.append("children=").append(children != null ? children.size() : 0).append("\t");
		str.append("\n");
		if (children != null) {
			for (SysMenu2 menu : children) {
				str.append("\t").append(menu.getId() + "\t" + menu.getName()).append("\n");
			}
		}
		str.append("\n");
		return str.toString();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getIdpath() {
		return idpath;
	}

	public void setIdpath(String idpath) {
		this.idpath = idpath;
	}

	public String getKind() {
		return kind;
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getOrdernum() {
		return ordernum;
	}

	public void setOrdernum(int ordernum) {
		this.ordernum = ordernum;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public int getVisible() {
		return visible;
	}

	public void setVisible(int visible) {
		this.visible = visible;
	}

	public List<SysMenu2> getChildren() {
		return children;
	}

	public void setChildren(List<SysMenu2> children) {
		this.children = children;
	}

}